home *** CD-ROM | disk | FTP | other *** search
/ Windows News 2005 November / WNnov2005.iso / Windows / Equipement / hMailServer / hMailServer-4.1-Build-136.exe / {app} / Addons / Utilities / EncryptAllPasswords.vbs < prev    next >
Text File  |  2005-01-02  |  724b  |  42 lines

  1. option explicit
  2.  
  3. dim oApp
  4. set oApp = CreateObject("hMailServer.Application")
  5.  
  6. dim oDomains
  7. set oDomains = oApp.Domains
  8.  
  9. dim iTotalCount
  10.  
  11. dim iDomainIdx
  12. For iDomainIdx = 0 To oDomains.Count -1
  13.  
  14.     dim oDomain
  15.     set oDomain = oDomains.Item(iDomainIdx)
  16.  
  17.     ' Iterate over user accounts
  18.     dim oAccounts
  19.     set oAccounts = oDomain.Accounts
  20.  
  21.     dim iAccountCount
  22.     iAccountCount = oAccounts.Count
  23.  
  24.     Dim iAccountIdx
  25.     
  26.     for iAccountIdx = 0 To iAccountCount - 1
  27.         dim oAccount
  28.         set oAccount = oAccounts.Item(iACcountIdx)
  29.  
  30.         oAccount.Save
  31.  
  32.         set oAccount = Nothing
  33.  
  34.         iTotalCount = iTotalCount +1
  35.     next 
  36.         
  37.     set oDomain = Nothing
  38. Next 
  39.  
  40. set oApp = Nothing
  41.  
  42. msgbox iTotalCount & " password(s) encrypted."